package com.sanminasci.msportal.web.action;

import javax.portlet.PortletSession;
import javax.servlet.jsp.PageContext;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class GetSessionAction extends ActionSupport {

	@Override
	public String execute() throws Exception {
//		ServletActionContext.getRequest().getSession().getServletContext().
		PageContext pageContext = (PageContext)ServletActionContext.getPageContext();
		org.apache.struts2.portlet.servlet.PortletHttpSession p =  (org.apache.struts2.portlet.servlet.PortletHttpSession)ServletActionContext.getRequest().getSession();
		PortletSession portletSession = p.getPortletSession();
		System.out.println(  ServletActionContext.getRequest().getSession().getClass().getName());
		System.out.println(pageContext ==null);
		if ( portletSession !=null ) {
			System.out.println( "timestatmpValue:"+portletSession.getAttribute("timestatmpValue"));
		}
		
		
		return super.execute();
	} 

}
